<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>演示</title>
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .body-bg {
            /*background-color:rgba(252, 248, 227, 0.85);*/
        }
        .page-header {
            margin:  0;
            position: fixed;
            width: 100%;
            background-color: rgba(238, 238, 238, 1);
            left: 0;
            padding: 10px;
            font-size:28px;
            border-bottom: 1px solid #7a7a7a;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
        }
        #scripture{
            margin-top: 65px;
        }
        #mainContent {
            display: none;
        }
        #mainContent h2{
            font-size: 124px;
        }
        #mainContent h3{
            font-size: 100px;
        }
        #mainContent h4{
            font-size: 76px;
        }
        #mainContent h5{
            font-size: 48px;
        }
        #mainContent span{
            float: left;
            height: 24px;
            width: 30px;
            font-size: 24px;
          }
          #mainContent  p{
            cursor: pointer;
            color: #000;
            padding-left: 18px;
            letter-spacing: 2px;
            font-size: 38px;
          }

        #btnFullscreen {
            margin-top: 100px;
            font-size: 128px;
        }

        #mainContent img {
            margin-left: -14px;
        }
        .txtRed{color:red !important;}
        /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
        ::-webkit-scrollbar {
            width: 4px;
            height: 4px;
            background-color: #F5F5F5;
        }
        /*定义滚动条轨道 内阴影+圆角*/
        ::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
            background-color: #F5F5F5;
        }
        /*定义滑块 内阴影+圆角*/
        ::-webkit-scrollbar-thumb {
            -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
            background-color: #555;
        }
    </style>
</head>

<body class="body-bg">
<div class="container-fluid">
    <div class="row">
        <div class="col-md-8 col-sm-offset-2 text-center">
            <button id="btnFullscreen" class="btn btn-success">启动全屏</button>
        </div>
        <div id="mainContent" class="col-sm-12 col-md-12">
        </div>
    </div>
</div>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script>
    var timer, scrollTop = parseInt(document.documentElement.scrollTop);
    var speed=100;
    var fontSize=38;
    function scrollWindow() {
        var isBottom = scrollTop >$(document).height();
        if (isBottom) {
            clearInterval(timer);
            scrollTop = 0;
        } else {
            scrollTop += 1;
            window.scrollTo(0, scrollTop);
        }
    }
    //设置演示内容
    function setContent(content) {
        scrollTop=0;
        $("#mainContent").html(content);
        $("#mainContent").find("[contenteditable=true]").removeAttr("contenteditable");
    }
    //显示诗歌
    function setPoetry(img) {
        $("#mainContent").html(img);
        imageSize();
        //autoScroll();
    }
    function imageSize() {
        var img=$("#mainContent").find("img");
        img.width($(document).width());
        //img.height($(document).height());
    }
    function scrollToTop(){
        window.scrollTo(0, 0);        
    }
    function autoScroll(isScroll) {
        if(isScroll){
            timer = setInterval("scrollWindow()", speed);
        }else{
            clearInterval(timer);
        }
    }
    function scrollGoTo(top) {
        $(window).animate({scrollTop: top}, 500);
    }
    function launchFullscreen(element) {
        if (element.requestFullscreen) {
            element.requestFullscreen();
        } else if (element.mozRequestFullScreen) {
            element.mozRequestFullScreen();
        } else if (element.webkitRequestFullscreen) {
            element.webkitRequestFullscreen();
        } else if (element.msRequestFullscreen) {
            element.msRequestFullscreen();
        }
    }
    function changeFontSize(size){
        fontSize=fontSize<38?38:fontSize+size;
        var h5=$("#mainContent").find("p");
        h5.css("font-size",  fontSize + "px");
    }
    $(function () {
        $("#btnFullscreen").click(function () {
            $(this).parent().hide();
            launchFullscreen(document.documentElement);
            $("#mainContent").show();
        });
        if (opener && opener.previewCallBack) {
            opener.previewCallBack();
        }

        $("#mainContent").on("click","p",function(){
            $(this).toggleClass("txtRed");
        });
        //$(window).resize(imageSize());
        //最大化
        $("window").width(window.screen.width);
        $("window").height(window.screen.height);
    });
</script>
</body>

</html>